﻿@model Unijovem.UI.Models.MusicaModel
@{
    ViewBag.Title = "Criar";
}
<link href="@Url.Content("~/Content/jquery.cleditor.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.cleditor.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.cleditor.xhtml.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $.cleditor.defaultOptions.width = 700;
        $.cleditor.defaultOptions.height = 300;
        $.cleditor.defaultOptions.controls = "bold italic underline color";
        $("#Letra").cleditor();
    });
</script>
<h2>
    Criar</h2>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>MusicaModel</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Titulo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Titulo)
            @Html.ValidationMessageFor(model => model.Titulo)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Letra)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Letra, 30, 80, null)
            @Html.ValidationMessageFor(model => model.Letra)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.UrlMp3)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UrlMp3)
            @Html.ValidationMessageFor(model => model.UrlMp3)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.IdAutor)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.IdAutor, (SelectList)ViewBag.Autores)<br />
            @Html.ValidationMessageFor(model => model.IdAutor)
        </div>

        @if (Model != null && Model.Id != 0)
        {
            @Html.HiddenFor(model => model.Id)
        }
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
